HipVertexArrayObject

For using this class, you must first define the vertex layout for after that, create the vertex buffer and/or the index buffer.

Constructors

this
this()

Remember calling sendAttributes

Members

Functions

appendAttribute
HipVertexArrayObject appendAttribute(uint count, HipAttributeType valueType, uint typeSize, string infoName, bool isPadding)

This function creates an attribute information, for later sending it(it is necessary as the stride needs to be recalculated)

appendAttribute
HipVertexArrayObject appendAttribute(string infoName, bool isPadding)
Undocumented in source. Be warned that the author may not have intended to support it.
bind
void bind()
Undocumented in source. Be warned that the author may not have intended to support it.
createIndexBuffer
void createIndexBuffer(index_t count, HipBufferUsage usage)

Creates and binds an index buffer.

createVertexBuffer
void createVertexBuffer(uint count, HipBufferUsage usage)

Creates and binds a vertex buffer.

sendAttributes
void sendAttributes(Shader s)

Sets the attribute infos that were appended to this object. This function must only be called after binding/creating a VBO, or it will fail

setIndices
void setIndices(index_t[] data)

Will set the indices data. Beware that this function may allocate memory.

setVertices
void setVertices(void[] data)

Sets the VBO data. Use this function only for initialization as it allocates memory.

unbind
void unbind()
Undocumented in source. Be warned that the author may not have intended to support it.
updateIndices
void updateIndices(index_t[] data, int offset)

Updates the index buffer's data. It won't allocate memory

updateVertices
void updateVertices(void[] data, int offset)

Update the VBO. Won't cause memory allocation.

Static functions

getVAO
HipVertexArrayObject getVAO()

Receives a struct and creates a VAO based on its member types and names.

putQuadBatchIndices
bool putQuadBatchIndices(index_t[] output, size_t countQuads)

Populates a buffer with indices forming quads Returns if the output can contain the size

Variables

EBO
IHipIndexBufferImpl EBO;
Undocumented in source.
VAO
IHipVertexArrayImpl VAO;
Undocumented in source.
VBO
IHipVertexBufferImpl VBO;
Undocumented in source.
dataCount
uint dataCount;

How many data slots it uses, for instance, vec3 will count +3

hasIndexInitialized
bool hasIndexInitialized;
Undocumented in source.
hasVertexInitialized
bool hasVertexInitialized;
Undocumented in source.
infos
HipVertexAttributeInfo[] infos;
Undocumented in source.
isBonded
bool isBonded;
Undocumented in source.
stride
uint stride;

Accumulated size of the vertex data

Meta